import Ajax from "./Ajax"

/**
 * 获取验证码
 * @param {string} phone 
 * @returns 
 */
export function getCodeApi(phone){
    return Ajax({
        url:"/get/code",
        data:{
            phone
        }
    })
}

/**
 * 注册接口
 * @param {{id:number,name:string,password:string,photo,sex,address,birthday: '', phone: '', email: '', remark: ''}} data 
 * @returns 
 */
export function registerApi(data){
    return Ajax({
        url:'/register',
        method:"PUT",
        data
    })
}

/**
 * 通过手机号登录接口
 * @param {*} data 
 * @returns 
 */
export function loginByPhoneApi(data){
    return Ajax({
        url:'/login/byphone',
        data
    })
}

export function suggestApi(){
    return Ajax({
        method:'GET',
        url:'/suggest/info'
    })
}